#!/usr/bin/python
# -*- coding: utf-8 -*-

##
 # Copyright 2009 Caio Souza
 # This file is part of Rpyg.
 #
 # Rpyg is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # Rpyg is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with Rpyg. If not, see <http://www.gnu.org/licenses/>.
 ##

'''Módulo de ações a serem realizadas sobre o jogo.'''

from Event import Event

class ChangeTile(Event):
    '''Muda o tile de uma posição do mapa.'''
    
    def __init__(self, trigger, tile, tilemap, i, j):
        '''Cria um evento para mudança de tile.'''
        
        Event.__init__(self, trigger, None, (tile, tilemap, i, j))
        
    def action(self, tile, tilemap, i, j):
        tilemap[i][j] = tile
        
class AddMove(Event):
    '''Adiciona uma lista de movimentação ao controle do personagem.'''
    
    def __init__(self, trigger, controller, moves):
        '''Cria um evento para adição de movimentos.'''
        
        Event.__init__(self, trigger, None, (controller, moves))
        
    def action(self, controller, moves):
        controller.addStates(moves)
        